package dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.zx.theline.R;

import base.BaseDialog;

/**
 * Created by Administrator on 2017/5/24.
 */

public class NewAppDialog extends BaseDialog {

    TextView cancel;
    TextView confirm;
    onClick monClick;

    public NewAppDialog(Context context) {
        super(context);
    }

    public NewAppDialog(Context context, int themeResId) {
        super(context, themeResId);
    }

    protected NewAppDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_newapp);
        InitView();
        InitData();
        InitListen();
    }

    @Override
    protected void InitView() {
        cancel = (TextView) findViewById(R.id.cancel);
        confirm = (TextView) findViewById(R.id.confirm);
    }

    @Override
    protected void InitData() {

    }

    @Override
    protected void InitListen() {
        cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                monClick.cancel();
                NewAppDialog.this.dismiss();
            }
        });

        confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                monClick.confirm();
            }
        });
    }

    public void setonClick(onClick monClick){
        this.monClick=monClick;

    }
    public interface onClick {
        void confirm();
        void cancel();
    }
}
